//
//  JokeTableViewCell.m
//  Days
//
//  Created by lanou3g on 16/1/7.
//  Copyright © 2016年 dss. All rights reserved.
//

#import "JokeTableViewCell.h"

#import "iflyMSC/IFlyMSC.h"

#import "DataHandel.h"

@interface JokeTableViewCell ()<IFlySpeechSynthesizerDelegate>
{
    IFlySpeechSynthesizer *_iFlySpeechSynthesizer;
}
@end

@implementation JokeTableViewCell


+(CGFloat)heightForLabelText:(NSString *)text
{

    //size
    CGSize size = CGSizeMake([UIScreen mainScreen].bounds.size.width-20, 1000);
    //attributes
    NSDictionary *dic = @{NSFontAttributeName:[UIFont systemFontOfSize:17]};
    //执行自适应高度方法,获取rect
    CGRect rect = [text boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    //返回设置好的高度
    return rect.size.height;



}

///播放按钮
- (IBAction)playBtnDidClicked:(id)sender {
    
    //发音人,默认为”xiaoyan”;可以设置的参数列表可参考个 性化发音人列表
    //xiaoyan xiaoyu xiaoqi xiaofeng xiaoxin xiaokun vixying陕西女声vils老孙粤语vixm 东北xiaoqian 台湾xiaolin
    [[DataHandel sharedHandel]readWithStr:self.contentLabel.text byreader:@"xiaokun" andDelegate:self];

}
#pragma mark -- 语音合成代理方法
//合成结束，此代理必须要实现
- (void) onCompleted:(IFlySpeechError *) error{

}
//合成开始
- (void) onSpeakBegin{
    
}
//合成缓冲进度
- (void) onBufferProgress:(int) progress message:(NSString *)msg{
}
//合成播放进度
- (void) onSpeakProgress:(int) progress{
}

@end
